<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<script type="text/javascript">
<!--
	function bal_mak_telfee_showHistory(uid) {
		$("#bal_mak_telfee_history", $.pdialog.getCurrent()).loadUrl(
				"bal_showTelfeeCheckHistory.action",
				{
					uuid : uid
				},
				function() {
					$("#bal_mak_telfee_history", $.pdialog.getCurrent()).find(
							"[layoutH]").layoutH();
				});
	}

	
	$("#bal_mak_telfee_firstrow", $.pdialog.getCurrent()).click();
	
//-->
</script>
<div class="pageContent">
	<c:choose>
		<c:when test="${empty errorMsg }">
			<c:choose>
				<c:when test="${empty balList}">
					<font color="red">* 该单据无结算明细信息！</font>
					<Br/><Br/><Br/><Br/><Br/><Br/><Br/>
				</c:when>
				<c:otherwise>
					<form method="post" action="bal_makApp.action"
						class="pageForm required-validate"
						onsubmit="return validateCallback(this, dialogAjaxDone)">
						<input name="uuid" type="hidden" value="${uuid }">
						<table width="100%">
							<tr>
								<td width="60%">
									<table id="bal_mak_telfee_table" class="list" width="100%"
										targetType="dialog" layoutH="50">
										<thead>
											<tr>
												<th>序号</th>
												<th>学校</th>
												<th>结算日期</th>
												<th>部门</th>
												<th>拓展人员</th>
												<th>维护人员</th>
												<th>电话费</th>
												<th>操作员费用</th>
												<th>结算费用</th>
												<th>批复金额</th>
												<th>备注</th>
											</tr>
										</thead>
										<tbody>
										<c:if test="${status.index==0 }">
										id="bal_mak_telfee_firstrow"
										</c:if>
											<c:forEach items="${balList }" var="bal" varStatus="status">
												<tr 
													<c:if test="${status.index==0 }">
														id="bal_mak_telfee_firstrow" class="selected"
													</c:if>
													onclick="javascript:bal_mak_telfee_showHistory('${bal.uuid}')">
													<td>${(status.index+1)}</td>
													<td>${bal.sclName }</td>
													<td>
														<fmt:parseDate value="${bal.ywEndDate}" var="ywEndDate" pattern="yyyyMMdd" /> 
														<fmt:formatDate value="${ywEndDate}" pattern="yyyy-MM-dd" />
													</td>
													<td>${bal.saleDeptName}</td>
													<td>${bal.saleUserName}</td>
													<td>${bal.saleKeepName}</td>
													<td><fmt:formatNumber value="${bal.telFee}"	type="number" pattern="￥0.00" /></td>
													<td><fmt:formatNumber value="${bal.operFee}"	type="number" pattern="￥0.00" /></td>
													<td><fmt:formatNumber value="${bal.balFee}" type="number" pattern="￥0.00" /></td>
													<td><fmt:formatNumber value="${bal.payFee}"	type="number" pattern="￥0.00" /></td>
													<td>${bal.specDeclare}</td>
												</tr>
											</c:forEach>
											<tr>
												<td colspan="9" align="right">合计：</td>
												<td><span id="bal_mak_telfee_totalFee"
													style="font-weight: bold;">${totalFee}</span> 
												</td>
												<td>${specDeclare}</td>
											</tr>
										</tbody>
									</table>
								</td>
								<td width="40%" style="vertical-align: top;">
									<div id="bal_mak_telfee_history" class="unitBox">&nbsp;</div>
								</td>
							</tr>
						</table>
						<div class="formBar">
							<ul>
								<li><div class="buttonActive">
										<div class="buttonContent">
											<button type="submit">保存</button>
										</div>
									</div></li>
								<li>
									<div class="button">
										<div class="buttonContent">
											<button type="button" class="close">取消</button>
										</div>
									</div>
								</li>
							</ul>
						</div>
					</form>
				</c:otherwise>
			</c:choose>
		</c:when>
		<c:otherwise>
			<div style="padding: 5px;color: red;">页面加载错误！${errorMsg }</div>
		</c:otherwise>
	</c:choose>
</div>